import request from '@/utils/request'

export default {
  // 列表
  query(data) {
    return request({
      url: `/v1/purchase/purchase-process/list`,
      method: 'post',
      data
    })
  },
  // 明细
  detail(params) {
    return request({
      url: `/v1/purchase/purchase-process/detail`,
      method: 'get',
      params
    })
  },
   // 获取选中明细(生成采购单使用)
   getDetail(data) {
    return request({
      url: `/v1/purchase/purchase-order/get-detail`,
      method: 'post',
      data
    })
  },
  // 批量提交
  submit(data) {
    return request({
      url: `/v1/purchase/purchase-process/batch-submit`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 批量改备注
  batchRemark(data) {
    return request({
      url: `/v1/purchase/purchase-process/batch-remark`,
      method: 'post',
      data
    })
  },
  // 批量取消
  batchCancel(data) {
    return request({
      url: `/v1/purchase/purchase-process/batch-cancel`,
      method: 'post',
      data
    })
  },
  // 采购单审核options
  auditOptions(params) {
    return request({
      url: `/v1/purchase/purchase-process/audit-flow`,
      method: 'get',
      params
    })
  },
  // 1688批量下单
  batchOrder(data) {
    return request({
      url: `/v1/purchase/purchase-process/batch-order`,
      timeout: 180000,
      method: 'post',
      data
    })
  },
  // 获取选中SKU
  getSku(data) {
    return request({
      url: `/v1/purchase/purchase-process/get-sku`,
      method: 'post',
      data
    })
  },
  // 调整采购人员
  updatePurchase(data) {
    return request({
      url: `/v1/purchase/purchase/update-purchase-user`,
      method: 'post',
      data
    })
  },
  // 批量修改备货方式
  editPrepareType(data) {
    return request({
      url: `/v1/purchase/purchase-process/edit-prepare-type`,
      method: 'post',
      data
    })
  },
  // 批量取消1688订单
  cancelOrder(data) {
    return request({
      url: `/v1/purchase/purchase-process/cancel-order`,
      method: 'post',
      data
    })
  },
  // 手动更新1688
  updatePlatform(data) {
    return request({
      url: `/v1/purchase/purchase-process/update-platform-price`,
      method: 'post',
      data
    })
  },
}
